package com.glsc.ngateway.common.base.domain.postgre6;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author: qiyr
 * @date: 2023/2/3 15:08
 * @description: 基金估值实体表
 */
@Data
@Entity
@Table(name = "t_excel_gzb")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@IdClass(ExcelGzb.PK.class)
public class ExcelGzb {
    public static class PK implements Serializable {
        private String date;
        private String fundName;
        private Integer rowId;

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }

        public String getFundName() {
            return fundName;
        }

        public void setFundName(String fundName) {
            this.fundName = fundName;
        }

        public Integer getRowId() {
            return rowId;
        }

        public void setRowId(Integer rowId) {
            this.rowId = rowId;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }
            PK pk = (PK) o;
            return Objects.equals(date, pk.date) && Objects.equals(fundName, pk.fundName) && Objects.equals(rowId, pk.rowId);
        }

        @Override
        public int hashCode() {
            return Objects.hash(date, fundName, rowId);
        }
    }

    @Id
    @Column(name = "fc_date")
    @ExcelProperty("估值日期")
    private String date;

    @Id
    @Column(name = "fc_fund_name")
    @ExcelProperty("基金名称")
    private String fundName;

    @Id
    @Column(name = "fl_row_id")
    @ExcelProperty("行号")
    private Integer rowId;

    @Column(name = "fc_subject_code")
    @ExcelProperty("科目代码")
    private String subjectCode;

    @Column(name = "fc_subject_name")
    @ExcelProperty("科目名称")
    private String subjectName;

    @Column(name = "fc_amount")
    @ExcelProperty("数量")
    private String amount;

    @Column(name = "fc_unit_price")
    @ExcelProperty("单位成本")
    private String unitPrice;

    @Column(name = "fc_cost")
    @ExcelProperty("成本")
    private String cost;

    @Column(name = "fc_cost_ratio")
    @ExcelProperty(value = "成本占净值")
    private String costRatio;

    @Column(name = "fc_val_price")
    @ExcelProperty(value = "市价")
    private String valPrice;

    @Column(name = "fc_val")
    @ExcelProperty("市值")
    private String val;

    @Column(name = "fc_val_ratio")
    @ExcelProperty("市值占净值")
    private String valRatio;

    @Column(name = "fc_valt_inc")
    @ExcelProperty("估值增值")
    private String valtInc;

    @Column(name = "fc_susp_info")
    @ExcelProperty("停牌信息")
    private String suspInfo;

    @Column(name = "fc_right_info")
    @ExcelProperty("权益信息")
    private String rightInfo;

    public ExcelGzb() {
    }

    public ExcelGzb(String date, String fundName, Integer rowId, String subjectCode, String subjectName,
                    String amount, String unitPrice, String cost, String costRatio, String valPrice, String val,
                    String valRatio, String valtInc, String suspInfo, String rightInfo) {
        this.date = date;
        this.fundName = fundName;
        this.rowId = rowId;
        this.subjectCode = subjectCode;
        this.subjectName = subjectName;
        this.amount = amount;
        this.unitPrice = unitPrice;
        this.cost = cost;
        this.costRatio = costRatio;
        this.valPrice = valPrice;
        this.val = val;
        this.valRatio = valRatio;
        this.valtInc = valtInc;
        this.suspInfo = suspInfo;
        this.rightInfo = rightInfo;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getFundName() {
        return fundName;
    }

    public void setFundName(String fundName) {
        this.fundName = fundName;
    }

    public Integer getRowId() {
        return rowId;
    }

    public void setRowId(Integer rowId) {
        this.rowId = rowId;
    }

    public String getSubjectCode() {
        return subjectCode;
    }

    public void setSubjectCode(String subjectCode) {
        this.subjectCode = subjectCode;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(String unitPrice) {
        this.unitPrice = unitPrice;
    }

    public String getCost() {
        return cost;
    }

    public void setCost(String cost) {
        this.cost = cost;
    }

    public String getCostRatio() {
        return costRatio;
    }

    public void setCostRatio(String costRatio) {
        this.costRatio = costRatio;
    }

    public String getValPrice() {
        return valPrice;
    }

    public void setValPrice(String valPrice) {
        this.valPrice = valPrice;
    }

    public String getVal() {
        return val;
    }

    public void setVal(String val) {
        this.val = val;
    }

    public String getValRatio() {
        return valRatio;
    }

    public void setValRatio(String valRatio) {
        this.valRatio = valRatio;
    }

    public String getValtInc() {
        return valtInc;
    }

    public void setValtInc(String valtInc) {
        this.valtInc = valtInc;
    }

    public String getSuspInfo() {
        return suspInfo;
    }

    public void setSuspInfo(String suspInfo) {
        this.suspInfo = suspInfo;
    }

    public String getRightInfo() {
        return rightInfo;
    }

    public void setRightInfo(String rightInfo) {
        this.rightInfo = rightInfo;
    }
}
